home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
Recent1
/
Filer4_01.lha
/
Filer
/
Rexx
/
FilerTM.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-24
|
4KB
|
114 lines
/*
$VER: FilerTM.rexx 1.2 (24.09.96)
Author:
Michael Böhnisch <billy@uni-paderborn.de> (mb)
Matthias Scheler <tron@lyssa.owl.de> (ms)
Function:
Makes FilerCom functionality available to ToolManager® dock icons.
Call:
FilerTM Load Filer if necessary and pop it to front
FilerTM dir1 Additionally read in source directory dir1
FilerTM dir1 dir2 Additionally read in both directories
FilerTM path/file Read path in source directory then perform
default action to file
History:
30.05.94 1.0 Initial Release (mb)
06.06.94 1.1 Now allows up to 10 Project/Tool icons
to be dropped simultaneously on the TM
dock icon. (mb)
24.09.96 1.2 replaced "SELECTENTRY" with "SELECTBYNAME"
*/
PARSE ARG Object.1 Object.2 Object.3 Object.4 Object.5 Object.6 Object.7 Object.8 Object.9 Object.10 .
/* -------------------------------------------------------------------- */
/* Start Filer if not already running. */
/* -------------------------------------------------------------------- */
IF ~SHOW( 'P', 'FilerRexx' ) THEN DO
ADDRESS COMMAND
'Run >NIL: Filer'
/* ---------------------------------------------------------------- */
/* Wait up to 50 seconds for Filer's AReXX port, time out if it */
/* does not show up after this period. */
/* ---------------------------------------------------------------- */
DO 5 WHILE ~SHOW( 'P', 'FilerRexx' )
'WaitForPort FilerRexx'
END
IF RC = 5 THEN DO
SAY 'Unable to load Filer'
EXIT
END
END
/* -------------------------------------------------------------------- */
/* By reaching this point Filer should be up'n running. Pull the screen */
/* to the front and respond to the arguments */
/* -------------------------------------------------------------------- */
ADDRESS 'FilerRexx'
FILERTOFRONT
IF Object.1 ~= "" THEN DO /* Are there any arguments at all? */
/* ---------------------------------------------------------------- */
/* Load rexxsupport function host if not already present */
/* ---------------------------------------------------------------- */
IF ~SHOW( 'L', 'rexxsupport.library' ) THEN DO
ADDLIB( 'rexxsupport.library', 0, -30, 0 )
END
/* ---------------------------------------------------------------- */
/* Get type of arguments and react depending to the type */
/* ---------------------------------------------------------------- */
IF LEFT( STATEF( Object.1 ), 1 ) = 'D' THEN DO
/* ------------------------------------------------------------ */
/* First argument is a directory */
/* ------------------------------------------------------------ */
READSOURCEDIR Object.1
IF Object2 ~= "" THEN DO
IF LEFT( STATEF( Object.2 ), 1 ) = 'D' THEN DO
/* ---------------------------------------------------- */
/* Second argument valid and is a directory */
/* ---------------------------------------------------- */
READTARGETDIR Object.2
OTHERDIR
END
END
END
ELSE DO
/* ------------------------------------------------------------ */
/* First argument is a file, ignore other argument(s) */
/* ------------------------------------------------------------ */
DO i = 1 TO 10
IF Object.i ~= "" THEN DO
divpos = MAX( LASTPOS( ':', Object.i ), LASTPOS( '/', Object.i ) ) + 1
READSOURCEDIR STRIP( LEFT( Object.i, divpos - 1 ), 'T', '/' )
'SELECBYNAME "'||SUBSTR( Object.i, divpos )||'"'
ACTION
END
END
END
END